package com.pinyoumei.app.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.pinyoumei.app.R;
import com.pinyoumei.app.bean.ZBKOrderListDetailBean;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2021-06-30.
 * --------- 日期 ------- 维护人 ------------ 变更内容 --------
 * 2021-06-30        Administrator             新增Person类
 * 2021-06-30        Administrator             增加sex属性
 */
public class ZbkOrderDetailListAdapter extends BaseQuickAdapter<ZBKOrderListDetailBean.ResultBean.OrderDetailBean.GoodsInfoBean.GoodsListBean, BaseViewHolder> {
    public ZbkOrderDetailListAdapter(int layoutResId, @Nullable List<ZBKOrderListDetailBean.ResultBean.OrderDetailBean.GoodsInfoBean.GoodsListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ZBKOrderListDetailBean.ResultBean.OrderDetailBean.GoodsInfoBean.GoodsListBean item) {
        ImageView image = helper.getView(R.id.image);

        Glide.with(mContext).load( item.getGoods_img()).into(image);

        helper.setText(R.id.text_name,item.getGoods_name()+"");

        helper.setText(R.id.tv_country_price,item.getGoods_price()+"");

        helper.setText(R.id.tv_unit,item.getUnit_name()+"");

        helper.setText(R.id.text_num,"数量：×" + item.getGoods_num());
    }
}
